package md.lanjing.com.module_deal_center.ui.fragment;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import com.lxh.baselibray.base.XFragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import md.lanjing.com.module_deal_center.R;
import md.lanjing.com.module_deal_center.R2;
import md.lanjing.com.module_deal_center.ui.adapter.CommonFragmentPagerAdapter;


/**
 * 寄售订单
 */
public class ConsignOrderFragment extends XFragment {
    @BindView(R2.id.tabLayout)
    TabLayout tabLayout;
    @BindView(R2.id.viewPager)
    ViewPager viewPager;

    @Override
    public void initData(Bundle savedInstanceState) {
        List<Fragment> fragmentList=new ArrayList<>();
        fragmentList.add(new SalingFragment());
        fragmentList.add(ConsignOrderStateFragment.newInstance(1));
        fragmentList.add(ConsignOrderStateFragment.newInstance(2));
        fragmentList.add(ConsignOrderStateFragment.newInstance(3));
        String[] titleArr=new String[]{"出售中","已锁定","审核中","已完成"};
        CommonFragmentPagerAdapter adapter=new CommonFragmentPagerAdapter(getChildFragmentManager(),fragmentList,titleArr);
        viewPager.setAdapter(adapter);
        tabLayout.setupWithViewPager(viewPager);
    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_consign_order;
    }

}
